Skip to content

HDDS-14179. StorageVolume.getCurrentUsage() should return a fixed usage.#9504

Merged
adoroszlai merged 1 commit intoapache:masterfrom
szetszwo:HDDS-14179
Dec 15, 2025
Merged

HDDS-14179. StorageVolume.getCurrentUsage() should return a fixed usage.#9504
adoroszlai merged 1 commit intoapache:masterfrom
szetszwo:HDDS-14179

Conversation

@szetszwo
Copy link
Copy Markdown
Contributor

@szetszwo szetszwo commented Dec 15, 2025

What changes were proposed in this pull request?

StorageVolume.getCurrentUsage() currently returns SpaceUsageSource, which looks like a mutable source. However, the underlying implementations always return SpaceUsageSource.Fixed. If the usages are mutable, we cannot sort them or use them to do computation reliably. We need this for for HDDS-14175.

What is the link to the Apache JIRA

HDDS-14179

How was this patch tested?

By existing tests.

@szetszwo szetszwo requested a review from adoroszlai December 15, 2025 19:40
Copy link
Copy Markdown
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @szetszwo for the patch. The change looks good.

I prefer using the more generic interface, but can see how having a more specific return type can help reasoning about the code.

@szetszwo
Copy link
Copy Markdown
Contributor Author

@adoroszlai , thanks for reviewing this!

... prefer using the more generic interface, ...

This is for HDDS-14175. Otherwise, the usages cannot be sorted reliably if they are mutable.

@adoroszlai adoroszlai merged commit 6759708 into apache:master Dec 15, 2025
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants